<template>
  <div>
    <NavType />
    <List />
    <Recommend />
    <Rank />
    <Like />
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor"/>
    <Brand />
  </div>
</template>

<script>
import List from "./List";
import Recommend from "./Recommend";
import Rank from "./Rank";
import Like from "./Like";
import Floor from "./Floor";
import Brand from "./Brand";

import { requestFloorList } from "@api/Home"

export default {
  name: "Home",
  components: {
    List,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand,
  },
  data() {
    return {
      floorList: [],
    };
  },
  methods: {
    // 获取 floor 数据方法
    async getFloorList() {
      this.floorList = await requestFloorList()
    }
  },
  mounted() {
    // 页面初始化调用 getFloorList() 获取 bannerfloorListList 数据
    this.getFloorList()
  },
};
</script>

<style lang="less" scoped>
</style>